<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<div class="row">
	<div class="col-lg-10 mx-auto">
		<div class="card">
			<div class="card-body">
				<form action="<?php echo url("plugin-setting-xn_qq_login");?>" method="post" id="form">
					<h4 class="card-title">设置</h4>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">是否开启手机找回密码：</label>
						<div class="col-sm-10">
							<?php echo $input['mobile_find_pw_on']; ?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">登陆方式：</label>
						<div class="col-sm-10">
							<select name="mobile_login_type">
								<option value="1">手机 / Email / 用户名</option>
								<option value="2">手机 / Email</option>
								<option value="3">手机 / 用户名</option>
								<option value="4">手机</option>
							</select>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">个人中心绑定手机号：</label>
						<div class="col-sm-10">
							<?php echo $input['mobile_bind_on']; ?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">强制用户绑定手机才能发帖：</label>
						<div class="col-sm-10">
							<?php echo $input['mobile_post_must_bind']; ?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">发送短信的平台：</label>
						<div class="col-sm-10">
							<?php echo $input['mobile_post_must_bind']; ?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">账号：</label>
						<div class="col-sm-10">
							<?php echo $input['mobile_post_must_bind']; ?>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"></label>
						<div class="col-sm-10">
							<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
							<a role="button" class="btn btn-secondary btn-block mt-3" href="javascript:history.back();"><?php echo lang('back');?></a>
						</div>
					</div>
				</form>
				<p class="my-3 small">注：申请地址：<a href="https://buy.cloud.tencent.com/sms" target="_blank">https://buy.cloud.tencent.com/sms</a></p>
				<p class="my-3 small">注：QQ 回调地址：<?php $path = http_url_path(); echo substr($path, 0, strrpos(substr($path, 0, -1), '/'));?>/qq_login-return.htm (填入到 QQ 开发平台)，注意必须开启 <a href="https://bbs.xiuno.com/thread-2.htm" target="_blank">URL-Rewrite</a>。</p>
			</div>
		</div>
	</div>
</div>

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>

<script>
var jform = $("#form");
var jsubmit = $("#submit");
var referer = '<?php echo http_referer();?>';
jform.on('submit', function(){
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.text(message).delay(2000).button('reset').location(referer);
			return;
		} else {
			$.alert(message);
			jsubmit.button('reset');
		}
	});
	return false;
});
</script>